import axios from 'axios'
const service = axios.create({
    baseURL: "http://localhost:3000",
    timeout: 5000,
    retries: 3, // 设置重试次数为3次
    retryDelay: 1000, // 设置重试的间隔时间
})
service.interceptors.request.use(
    config => {
        config.headers['Authorization'] = 'Beaer token'
        return config
    },
    error => {
        console.log('request error', error);
        return Promise.reject(error)
    }
)
service.interceptors.response.use(
    response => {
        return response.data
    },
    error => {
        console.log('response error', error);
        return Promise.reject(error)
    }
)
export default service